package com.nzy.test;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class StringClass {

    public static void main1(String[] args) {
        String str = "///cash/dataManage/batchManage/";
        String[] s = str.split("/");

        StringBuilder stringBuilder = new StringBuilder();
        for(String ss : s){
            if(ss.length() != 0){
                stringBuilder.append(ss).append("/");
            }
        }
        System.out.println(stringBuilder.toString());
    }

    public static void main2(String[] args) {
        Long orgId = null;
        System.out.println(orgId == null? 0L: orgId);
        String aa="AAAASadas";
        int hashCode = aa.hashCode();
        System.out.println(hashCode);

        System.out.println(Arrays.asList(1L));

    }

    public static void main(String[] args) {
        String[] strd = {"1","2", "3", "4","5"};
        List<String> s = Arrays.asList(strd);

        List<String> r = s.stream().filter(item -> item.equals("1") || item.equals("2")).collect(Collectors.toList());
        System.out.println(r);
    }
}
